
/*Zepto(function($){

	var List = Backbone.Model.extend();
	
	var ListView =  Backbone.View.extend({
		initialize:function(){
			this.render();
		},
		events:{
			"click li":"onClick"
		},
		onClick:function(e){
			var li = $(e.target);
			alert("item("+$(li).attr("id")+")-->"+$(li).text());
		},
		el:$("ul"),
		template:_.template($("script#lista").html()),
		render:function(){
			$(this.el).html(this.template(this.model.toJSON()));
			return this;
		}
	});
	
	var lista = new List({
		array:[{id:1,title:"Manzana"},
			   {id:2,title:"Naranja"},
			   {id:3,title:"Pera"},
			   {id:4,title:"Platano"}]
	});
	
	var listView = new ListView({model:lista});
	
	
	
	//.- Sin Back-bone
	
	$("a#save-person").click(function(){
	
		var name = $("input#input-name").val();
		var lastName = $("input#input-last-name").val();
	
		$.ajax({
			url:"/person",
			type:"POST",
			data:JSON.stringify({name:name,lastName:lastName}),
			contentType:"application/json;charset=utf-8",
			dataType:"json",
			success:function(data){
				console.log(data);
			},
			error:function(err){
				var msg = "Status: "+err.status+": "+err.responseText;
				alert(msg);
			}
					
		});
	
	});
	
	
	//Layout con backbone
	extends layout

block content
  script(src="/js/lib/zepto.min.js")
  script(src="/js/lib/underscore-min.js")
  script(src="/js/lib/backbone-min.js")
  script(src="/js/example.js")
  script#lista(type="text/template")    
    <% _.each(array,function(item,index){%>	
    <li id=li_<%=item.id%> ><%=item.title%></li>
    <%});%>


  h1 #{title}
  p Bienvenidos a, #{title}
  //#container hola neobits!!!
  ul#lista
  a(href='list') ir a list!!!
  
  h2 people
  label(for="input-name") Name:
  input#input-name
  label(for="input-last-name") Last Name:
  input#input-last-name
  a(href="#",id="save-person") save person
	
	
	
	
	
});
*/